package es.ranking.padel.serviciosImpl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import es.ranking.padel.dao.UserDao;
import es.ranking.padel.entidades.User;
import es.ranking.padel.servicios.UserService;


/**
 * The Class UserServiceImpl.
 */
@Transactional(readOnly = true)
public class UserServiceImpl implements UserService{

   
   /** The user dao. */
   private UserDao userDao;
 
    /**
     * Add User.
     *
     * @param user the user
     */
    @Transactional(readOnly = false)
    public void addUser(User user) {
    	userDao.addUser(user);
    }
 
    /**
     * Delete User.
     *
     * @param user the user
     */
    @Transactional(readOnly = false)
    public void deleteUser(User user) {
    	userDao.deleteUser(user);
    }
 
    /**
     * Update User.
     *
     * @param user the user
     */
    @Transactional(readOnly = false)
    public void updateUser(User user) {
    	userDao.updateUser(user);
    }
 
    /**
     * Get User.
     *
     * @param id the id
     * @return the user by id
     */
    public User getUserById(int id) {
        return userDao.getUserById(id);
    }
 
    /**
     * Get User List.
     *
     * @return the users
     */
    public List<User> getUsers() {
        return userDao.getUsers();
    }

	/**
	 * Gets the user dao.
	 *
	 * @return the user dao
	 */
	public UserDao getUserDao() {
		return userDao;
	}

	/**
	 * Sets the user dao.
	 *
	 * @param userDao the new user dao
	 */
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

}
